#include "FrontEndState.h"

FrontEndState::FrontEndState(GameContext& gameC)
	:	GameState(gameC)
{

}
FrontEndState::~FrontEndState()
{
}
void FrontEndState::Load()
{
	mFont.Load(20);
	mCursor.Load("sword.png");

	mStartButton1.Load("button_on.png", "button_off.png");
	mStartButton1.SetPosition(SGE::SVector2(200.0f, 500.0f));
	mStartButton1.SetText("Level 1", 255,255,255);

	mStartButton2.Load("button_on.png", "button_off.png");
	mStartButton2.SetPosition(SGE::SVector2(200.0f, 550.0f));
	mStartButton2.SetText("Level 2", 255,255,255);

	mQuitButton.Load("button_on.png", "button_off.png");
	mQuitButton.SetPosition(SGE::SVector2(200.0f, 600.0f));
	mQuitButton.SetText("quit", 255,255,255);
}
void FrontEndState::Unload()
{
	mFont.Unload();
	mCursor.Unload();
	mStartButton1.Unload();
	mStartButton2.Unload();
	mQuitButton.Unload();

}
NextStates FrontEndState::Update(float deltaTime)
{
	mCursor.Update(deltaTime);
	mStartButton1.Update(deltaTime);
	mStartButton2.Update(deltaTime);
	mQuitButton.Update(deltaTime);
	NextStates nextState = None;
	if(mStartButton1.IsPressed())
	{
		nextState = Gameplay;
	}
	else if(mStartButton2.IsPressed())
	{
		nextState = Gameplay;
	}
	else if(mQuitButton.IsPressed())
	{
		nextState = Quit;
	}
	return nextState;
}
void FrontEndState::Render()
{
	mFont.Print("A Link to Pikachu's Past", 100,100);
	
	mStartButton1.Render();
	mStartButton2.Render();
	mQuitButton.Render();
	mCursor.Render();
}